package com.hxkj.dao.impl;

import com.hxkj.dao.AdvertisementDao;
import com.hxkj.mapper.AdvertisementMapper;
import com.hxkj.domain.po.Advertisement;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;


/**
* 数据操作实现
*
* @author: chenwei
* @version: 1.0
* @datetime: 2018-09-07 15:29:10
*
*/
@Service("advertisementDao")
public class AdvertisementDaoImpl implements AdvertisementDao {

    @Resource
    private AdvertisementMapper advertisementMapper;

    @Override
    public Advertisement get(Long advertisementId) {
        return advertisementMapper.selectByPrimaryKey(advertisementId);
    }

    @Override
    public List<Advertisement> get(Advertisement advertisement) {
        return advertisementMapper.select(advertisement);
    }

    @Override
    public int delete(Long advertisementId) {
        return advertisementMapper.deleteByPrimaryKey(advertisementId);
    }

    @Override
    public int delete(Advertisement advertisement) {
        return advertisementMapper.delete(advertisement);
    }

    @Override
    public int save(Advertisement advertisement) {
        return advertisementMapper.insert(advertisement);
    }

    @Override
    public int update(Advertisement advertisement) {
        return advertisementMapper.update(advertisement);
    }

    @Override
    public List<Advertisement> checkRepeat(Advertisement advertisement) {
        return advertisementMapper.checkRepeat(advertisement);
    }
}
